#ifndef USER_H

#define USER_H 1

#include "include/const.h"
#include <stdlib.h>
#include <stdbool.h>

//配置文件结构体
typedef struct UserInfo {
	char uname[UNAME_LEN];
	char passwd[PASSWD_LEN];
	char priv[PRIV_CMD_LEN];
	struct UserInfo *next;
} user, *user_ptr;
//配置文件行长度
#define USER_LINE_LEN 1024

bool user_init(user_ptr *ul);
void user_push(user_ptr ul, user_ptr user_n);
bool user_parser(user_ptr ul, FILE *fp);
int user_size(user_ptr ul);
void user_destroy(user_ptr *ul);
void user_traverse(user_ptr ul, void (*func)(user_ptr));
user_ptr user_auth(user_ptr ul, char *uname, char *passwd);
void print_u(user_ptr user_n);

#endif
